package personal.wang.util;

import java.net.InetSocketAddress;
import java.net.UnknownHostException;

public class SystemInfoUtil {
    public static String getLocalIP(){
        String ip = null ;
        try {
            ip = java.net.InetAddress.getLocalHost().getHostAddress();
        } catch (UnknownHostException e) {
            throw new RuntimeException(e);
        }
        return ip ;
    }
    public static String getLocalHost(){
        String host = null ;
        try {
            host = java.net.InetAddress.getLocalHost().getHostName();
        } catch (UnknownHostException e) {
            throw new RuntimeException(e);
        }
        return host ;
    }
}
